<?php

/**
 *
 * @time 2022-7-25
 * @uthor 王恒兵
 */

namespace Cal\server;

use Cal\CalReply;
use Cal\CalRequest;
use Grpc\ServerContext;

class ServerSub
{
    public function Add(
        CalRequest          $request,
        ServerContext $context
    ): ?CalReply {
        $context->setStatus(\Grpc\Status::unimplemented());
        return null;
    }

    public function Sub(
        CalRequest    $request,
        ServerContext $context
    ):?CalReply {
        $context->setStatus(\Grpc\Status::unimplemented());
        return null;
    }

    public final function getMethodDescriptors()
    {
        return [
            '/Cal.Cal/Add' => new \Grpc\MethodDescriptor(
                $this,
                'Add',
                '\Cal\CalRequest',
                \Grpc\MethodDescriptor::UNARY_CALL
            ),
            '/Cal.Cal/Sub' => new \Grpc\MethodDescriptor(
                $this,
                'Sub',
                '\Cal\CalRequest',
                \Grpc\MethodDescriptor::UNARY_CALL
            ),
        ];
    }
}